package service

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"maintenance_fund/internal/biz"

	v1 "maintenance_fund/api/system/v1"
)

type SysUserService struct {
	v1.UnimplementedSysUserServer

	uc *biz.SysUserUsecase

	log *log.Helper
}

func NewSysUserService(uc *biz.SysUserUsecase, logger log.Logger) *SysUserService {
	return &SysUserService{uc: uc, log: log.NewHelper(logger)}
}

func (s *SysUserService) CreateSysUser(ctx context.Context, req *v1.CreateSysUserRequest) (*v1.CreateSysUserReply, error) {
	err := s.uc.CreateSysUser(ctx, &biz.SysUser{
		UserName:     req.UserName,
		NickName:     req.NickName,
		UserPassword: req.UserPassword,
		Phone:        req.Phone,
		ProvinceCode: req.ProvinceCode,
		CityCode:     req.CityCode,
		AreaCode:     req.AreaCode,
	})
	if err != nil {
		return nil, err
	}
	return &v1.CreateSysUserReply{}, nil
}
func (s *SysUserService) UpdateSysUser(ctx context.Context, req *v1.UpdateSysUserRequest) (*v1.UpdateSysUserReply, error) {
	return &v1.UpdateSysUserReply{}, nil
}
func (s *SysUserService) DeleteSysUser(ctx context.Context, req *v1.DeleteSysUserRequest) (*v1.DeleteSysUserReply, error) {
	return &v1.DeleteSysUserReply{}, nil
}
func (s *SysUserService) GetSysUser(ctx context.Context, req *v1.GetSysUserRequest) (*v1.GetSysUserReply, error) {
	return &v1.GetSysUserReply{}, nil
}
func (s *SysUserService) ListSysUser(ctx context.Context, req *v1.ListSysUserRequest) (*v1.ListSysUserReply, error) {
	return &v1.ListSysUserReply{}, nil
}
func (s *SysUserService) ResetSysUserPassword(ctx context.Context, req *v1.ResetSysUserPasswordRequest) (*v1.ResetSysUserPasswordReply, error) {
	return &v1.ResetSysUserPasswordReply{}, nil
}
